package com.fss.cart1.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fss.common.annotation.Excel;
import com.fss.common.core.domain.BaseEntity;

/**
 * 购物车对象 shopping_cart
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
public class ShoppingCart extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 购物车ID */
    private Long cartId;

    /** 用户ID，关联sys_user表 */
    @Excel(name = "用户ID，关联sys_user表")
    private Long userId;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long quantity;

    /** 产品单价（加入购物车时的价格） */
    @Excel(name = "产品单价", readConverterExp = "加=入购物车时的价格")
    private BigDecimal price;

    /** 加入购物车时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "加入购物车时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date addedTime;

    public void setCartId(Long cartId) 
    {
        this.cartId = cartId;
    }

    public Long getCartId() 
    {
        return cartId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setQuantity(Long quantity) 
    {
        this.quantity = quantity;
    }

    public Long getQuantity() 
    {
        return quantity;
    }
    public void setPrice(BigDecimal price) 
    {
        this.price = price;
    }

    public BigDecimal getPrice() 
    {
        return price;
    }
    public void setAddedTime(Date addedTime) 
    {
        this.addedTime = addedTime;
    }

    public Date getAddedTime() 
    {
        return addedTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("cartId", getCartId())
            .append("userId", getUserId())
            .append("quantity", getQuantity())
            .append("price", getPrice())
            .append("addedTime", getAddedTime())
            .toString();
    }
}
